
package com.plian.system.service.fr.adjustment.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.plian.system.entity.fr.adjustment.AdjustmentColumn;
import com.plian.system.mapper.fr.adjustment.AdjustmentColumnMapper;
import com.plian.system.service.fr.adjustment.IAdjustmentColumnService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 预算调整表列定义表 服务实现类
 *
 * @author jianglei
 * @since 2021-09-15
 */
@Service
@AllArgsConstructor
public class AdjustmentColumnServiceImpl extends ServiceImpl<AdjustmentColumnMapper, AdjustmentColumn> implements IAdjustmentColumnService {

    @Override
    public String columnNumberToColumnId(int columnNumber, String sheetId) {
        AdjustmentColumn adjustmentColumn = getOne(Wrappers.<AdjustmentColumn>lambdaQuery()
                .eq(AdjustmentColumn::getOrgId, sheetId).eq(AdjustmentColumn::getOrderNumber, columnNumber));
        if (adjustmentColumn != null){
            return adjustmentColumn.getColumnId();
        }
        return null;
    }
}
